import React, { Component } from 'react';
import MyLeft from '../../components/MyLeft';
import MyRight from '../../components/MyRight';
import MyHeader from '../../components/MyHeader';
import Top from '../../components/Top';
class Goods extends Component {
    state={
        currentIndex:0,
        cate:[], 
    }  
      handelClick(index){
        this.setState({
         currentIndex:index
        })
      }
      render() {
        return (
          <div className='app'>
            {/* 头部 */}
            <Top>分类</Top>
            {/* jsx语法中写js代码要用{}包裹 */}
            {/* 搜索 */}
            <MyHeader></MyHeader>
          <div className="main">
            {/* 左侧导航 */}
         <MyLeft cate={this.state.cate} currentIndex={this.state.currentIndex} handelClick={this.handelClick.bind(this)}></MyLeft>
            {/* 右侧内容 */}
          <MyRight cate={this.state.cate} currentIndex={this.state.currentIndex}></MyRight>
          </div>
          </div>
        );
      }
    }

export default Goods;